<? $i=0; ?>
<div class="dmf-widget-table">
    {Dependencies}
    
    <div class="dmf-widget-attributes" style="display:none;">
        @foreach( $this->data_attributes as $key => $value )
        {
        <div class="@$key">@$value</div>
        }
    </div>
    
    @if ( $this->data_attributes['search'] == 'true' && $this->data_attributes['search_loc'] == 'top' )
    {
    <div class="dmf-search">
        <input type="text" class="dmf-search-query" />
    </div>
    }
    
    <table class="dmf-headers">
        @if ( $this->empty )
        {
        <tr class="dmf-tr">
            <td class="dmf-td">
                Geen data
            </td>
        </tr>
        }
        @else
        {
            <tr class="dmf-tr">
            @foreach( $this->data['headers'] as $header )
            {
                <th class="dmf-th">@$header</th>
            }
            </tr>
        }
    </table>
    <div class="dmf-scrollable-table">
    <table id="<? echo rand(0,999999) ?>" class="dmf-table<? if ( $this->data_attributes['sortable'] == 'true' ) echo ' sortable'; ?>">
        @foreach( $this->data['body'] as $item )
        {
            <? $i++; if ( $i > $this->data_attributes['max'] && $this->data_attributes['max'] != 0 ) break; ?>
            <tr class="dmf-tr">
            @foreach( $item as $val )
            {
            <td class="dmf-td">@$val</td>
            }
            </tr>
        }
        </table>

        <input type="hidden" value="@$this->data_attributes['value']" name="@$this->data_attributes['name']" />
    </div>
    @if ( $this->data_attributes['search'] == 'true' && $this->data_attributes['search_loc'] == 'bottom' )
    {
    <div class="dmf-search">
        <input type="text" class="dmf-search-query" />
    </div>
    }
</div>